package com.lianzhihui.romeex.ui.trade.adapter;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lianzhihui.romeex.R;

import java.util.List;

/**
 * @ProjectName: romeex
 * @Package: com.lianzhihui.romeex.ui.trade.adapter
 * @ClassName: ExtractFragmentAdapter
 * @Description: java类作用描述
 * @Author: zhanghong
 * @CreateDate: 2020/10/30 17:38
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020/10/30 17:38
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class FlowCellFragmentAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    Context mContext;
    String selectStr = "";

    public void setSelectStr(String selectStr) {
        this.selectStr = selectStr;
    }

    public FlowCellFragmentAdapter(@Nullable Context mContext, @Nullable List<String> data) {
        super(R.layout.item_flow_cell_fragment, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, String item) {
        helper.setText(R.id.tv_input, item);

        if(item.equals(selectStr)){
            helper.setTextColor(R.id.tv_input,mContext.getResources().getColor(R.color.yellow));
            helper.setVisible(R.id.iv_select,true);
        }else{
            helper.setTextColor(R.id.tv_input,mContext.getResources().getColor(R.color.text333));
            helper.setVisible(R.id.iv_select,false);
        }
    }
}
